const express = require('express')
const router = express.Router()
const userController = require('../controllers/userController')
const auth = require('../middleware/auth')

// 使用认证中间件
router.use(auth)

// 获取用户列表
router.get('/', userController.getList)

// 创建用户
router.post('/', userController.create)

// 批量删除用户
router.delete('/batch', userController.batchDelete)

// 批量更新用户状态
router.put('/batch/status', userController.batchUpdateStatus)

// 批量调整部门
router.post('/batch-update-department', userController.batchUpdateDepartment)

// 更新用户
router.put('/:id', userController.update)

// 删除用户
router.delete('/:id', userController.delete)

// 更新用户状态
router.put('/:id/status', userController.updateStatus)

// 重置用户密码
router.post('/:id/reset-password', userController.resetPassword)

// 设置用户个人权限
router.put('/:id/permissions', userController.setUserPermissions)

module.exports = router 